package com.hello.web.domain.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hello.web.domain.entity.UserRoleDO;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface UserRoleMapper extends BaseMapper<UserRoleDO> {


    default UserRoleDO findRoleIdByUserId(Long userId) {
        return selectOne(
                new LambdaQueryWrapper<>(UserRoleDO.class)
                        .eq(UserRoleDO::getUserId, userId)
        );
    }

}
